From: River Tarnell Date: Sun, 3 Jul 2005 04:56:53 +0000 (+0000) Subject: fixes for action=render on image pages X-Git-Tag: 1.5.0beta2~64 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/%22%24diffUrl/%27.direction_css%28%24f%29.%27?a=commitdiff_plain;h=8e2724711f4ab6b796fb26d99b10f2317311140a;p=lhc%2Fweb%2Fwiklou.git fixes for action=render on image pages --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index dd78e39ec4..549b121970 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -19,6 +19,12 @@ class ImagePage extends Article { /* private */ var $img; // Image object this page is shown for + function render() { + global $wgOut; + $wgOut->setArticleBodyOnly(true); + $wgOut->addWikitext($this->getContent(true)); + } + function view() { global $wgUseExternalEditor, $wgOut, $wgShowEXIF; @@ -251,7 +257,7 @@ class ImagePage extends Article { if ($wgRepositoryBaseUrl && $wgFetchCommonsDescriptions) { $ur = ini_set('allow_url_fopen', true); - $text = @file($url); + $text = @file_get_contents($url); ini_set('allow_url_fopen', $ur); if ($text) $wgOut->addHTML($text); diff --git a/includes/OutputPage.php b/includes/OutputPage.php index f58fde9f06..336539bd92 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -69,6 +69,7 @@ class OutputPage { function setETag($tag) { $this->mETag = $tag; } function setArticleBodyOnly($only) { $this->mArticleBodyOnly = $only; } + function getArticleBodyOnly($only) { return $this->mArticleBodyOnly; } function addLink( $linkarr ) { # $linkarr should be an associative array of attributes. We'll escape on output.